//
//  UserIconImageCell.m
//  pmmSS
//
//  Created by Mac book on 2017/9/19.
//  Copyright © 2017年 WTFSSD. All rights reserved.
//

#import "UserIconImageCell.h"

@interface UserIconImageCell()

@property (nonatomic,strong) UILabel *label;


@end

@implementation UserIconImageCell

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{


    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];

    if (self) {

        [self initSubViews];
    }

    return self;
}

-(void)initSubViews{


    WeakSelf(weakSelf);

    _label = [HMLabel createLabelWithText:@"头像" andTextColor:RGBA(102, 102, 102, 1) andBgColor:nil andFont:[UIFont fontWithName:default_fontname size:autoScaleH(14)] andTextAlignment:NSTextAlignmentLeft];

    [self.contentView addSubview:_label];


    _IconImageView = [[UIImageView alloc]init];
    _IconImageView.backgroundColor = [UIColor yellowColor];
    _IconImageView.clipsToBounds = YES;
    _IconImageView.layer.borderWidth = 2;
    _IconImageView.layer.borderColor = RGBA(193, 208, 224, 1).CGColor;
    _IconImageView.layer.cornerRadius = autoScaleH(30.5);

    // [_imageView setImage:[UIImage imageWithData:[NSData dataWithContentsOfURL:[NSURL URLWithString:@"http://image.baidu.com/search/detail?ct=503316480&z=0&ipn=d&word"]]]];

    // [_imageView sd_setImageWithURL:[NSURL URLWithString:imageUrl]];

    [_IconImageView setImage:[UIImage imageNamed:@"list_icon_shop"]];

    [self.contentView addSubview:_IconImageView];

    [_label mas_makeConstraints:^(MASConstraintMaker *make) {

        make.centerY.mas_equalTo(weakSelf.contentView);
        make.left.mas_equalTo(autoScaleW(10));

        make.height.mas_equalTo(autoScaleW(20));

        make.width.mas_equalTo(autoScaleH(60));

    }];

    [_IconImageView mas_makeConstraints:^(MASConstraintMaker *make) {

        make.centerY.mas_equalTo(weakSelf.contentView);
        make.right.mas_equalTo(weakSelf.contentView).offset(autoScaleW(-30));

        make.height.mas_equalTo(autoScaleW(61));

        make.width.mas_equalTo(autoScaleH(61));
        
    }];


    UIImageView *rightImage = [[UIImageView alloc]init];

    [rightImage setImage:[UIImage imageNamed:@"icon_arrow_right_gray"]];
    [self.contentView addSubview:rightImage];

    [rightImage mas_makeConstraints:^(MASConstraintMaker *make) {

        make.centerY.mas_equalTo(weakSelf.contentView);
        make.right.mas_equalTo(weakSelf.contentView).offset(autoScaleW(-15));

        make.height.mas_equalTo(autoScaleW(18));

        make.width.mas_equalTo(autoScaleH(9));
        
    }];
    

}

@end
